/*
 ------------------------------------------------------------------------------
 Copyright (C) 2009-2011 Eternal Games.

 This file is part of the Eternal Tech source code.

 The Eternal Tech source code is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or (at your
 option) any later version.

 The Eternal Tech source code is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 more details.

 You should have received a copy of the GNU General Public License along with
 the Eternal Tech source code; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ------------------------------------------------------------------------------
*/


//
// s_channel.cpp - ...
//


#include "s_local.h"


/*
 ==============================================================================

    CHANNEL PHYSICS

 ==============================================================================
*/


static void S_SpatializeChannel (channel_t *channel)
{
}


/*
 ==============================================================================

    CHANNEL STATES

 ==============================================================================
*/


void S_PlayChannel (channel_t *channel)
{
}

void S_StopChannel (channel_t *channel)
{
}

void S_UpdateChannel (channel_t *channel)
{
}


/*
 ==============================================================================

    CONSOLE COMMANDS

 ==============================================================================
*/


static void S_ListActiveChannels_f ()
{
}


/*
 ==============================================================================

    INITIALIZATION AND SHUTDOWN

 ==============================================================================
*/


/*
 ==================
 S_InitChannels
 ==================
*/
void S_InitChannels ()
{
	channel_t	*channel;
	int			i;

	// Add commands
	Cmd_AddCommand("listActiveChannels", S_ListActiveChannels_f);

	// Allocate the channels
	for (i = 0, channel = snd.channels; i < s_maxChannels->integerValue; i++, channel++)
	{
		qalGenSources(1, &channel->sourceId);

		if (qalGetError() != AL_NO_ERROR)
			break;

		snd.numChannels++;
	}
}

/*
 ==================
 S_ShutdownChannels
 ==================
*/
void S_ShutdownChannels ()
{
	channel_t	*channel;
	int			i;

	// Remove commands
	Cmd_RemoveCommand("listActiveChannels");

	// Delete all the channels
	for (i = 0, channel = snd.channels; i < snd.numChannels; i++, channel++)
		qalDeleteSources(1, &channel->sourceId);
}